<?php
namespace app\admin\controller;
use think\Controller;
use sand\handle;
use app\admin\controller\Base;
/**
* 
*/
class Index extends Base
{
    public function index(){
    	$params = require_once CONF_PATH.'sand/config/params.php';
        $cert = require_once CONF_PATH.'sand/config/cert.php';
        $idCardVerify = $params['QueryBalance'];
        $idCardVerify['pt']['name'] =input("post.name");
        $idCardVerify['pt']['certType'] =input("post.certType");
        $idCardVerify['pt']['certNo'] =input("post.certNo");
        $idCardVerify['pt']['returnPic'] =0;
        $handle = new handle($cert);
        $res=json_decode($handle->execute($idCardVerify));
        $balance=$res->respCode=="0000"?($res->balance/100)."元":"未获取";
        $this->assign('balance',$balance);
        return $this->fetch();

    }
    public function test(){
        // 链接远程服务器    
            echo phpinfo();  
        $connection = ssh2_connect('222.73.39.37', '50022');    
            
        if (!$connection) die('connection to '.$host.':22 failed');    
         
    }
}
